<layout name="layout"/>
<section class="content-header">
    <h1>
        设置用户
    </h1>
</section>

<div class="content">
    <div class="box box-info">
        <div class="box-header with-border">
        </div>
        <form id="form" action="" class="form-horizontal" method="post">
            <input style="display: none" value="{$id}" name="id" id="id">
            <input style="display: none" value="{$userids}" name="userids" id="userids">
            <div class="box-body table-responsive no-padding">
                <table id="sample-table-1" class="table table-hover">
                    <thead>
                    <tr>
                        <th style="width: 1%;text-align: center"><input name="pmenu" type="checkbox"
                                                                        onclick="checktb(this,'userids')"
                                /></th>
                        <th style="width: 45%;text-align: center">用户名称</th>
                        <th style="width: 45%;text-align: center">备注</th>
                    </tr>
                    </thead>

                    <tbody>
                    <volist name="users" id="vo">
                        <tr>
                            <td style="text-align: center;vertical-align: middle"><input id="{$vo.id}"
                                                                                         onclick="checktb(this,'userids')"
                                                                                         type="checkbox"
                                    />
                            </td>
                            <td style="text-align: center;vertical-align: middle">{$vo.name}</td>
                            <td style="text-align: center;vertical-align: middle">{$vo.notes}</td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
            </div>
            <div class="box-footer">
                <a href="javascript:void(0)" onclick="commonSubmit('form','__APP__/home/role/configUserEntity','')"
                   class="btn btn-primary pull-right" style="margin-left: 5px">提交</a>
                <a href="__APP__/home/role" class="btn btn-default  pull-right">返回</a>
            </div>
            <!-- /.box-footer -->
        </form>
    </div>
</div>
<script>
    $(document).ready(function () {
        var userids = '{$userids}';
        var ids = userids.split(',');
        $(ids).each(function () {
            $('#' + this).prop('checked', true);
        })
    });
</script>
